## This file loads and formats the data for the democracy example and creates
## other objects needed for making graphs

## Load data ------------
# BRS package has correctly formatted the data for this example
data(lipset_df)
X <- lipset_df

data(lipset_Y)
Y <- lipset_Y


## Objects that will be needed for making plots ------------
# Feature names (without values) as they appear in X and their corresponding labels
# (see description of .get_df_chord in helper.R; fgs corresponds to the input featureGroups)
fgs <- cbind(unique(unlist(lapply(colnames(X), function(x) strsplit(x, "_")[[1]][[1]]))),
             c("Wealth", "Urbanization", "Education", "Industrialization"))

# Features as they appear in X and their corresponding labels
# (see description of getLabel in helper.R; fdf corresponds to the input labels_df)
fdf <- cbind(colnames(X),
             c("Wealth (high)", "Wealth (med)", "Wealth (low)",
               "Urbanization (high)", "Urbanization (low)", 
               "Education (high)", "Education (low)", 
               "Industrialization (high)", "Industrialization (low)"))
# Equivalence classes 
# (see description of the simplifyCondition function in helper.R)
oppmat <- matrix(c(0,1), ncol=2)
oppind <- list(unique(unlist(lapply(colnames(X), function(x) strsplit(x, "_")[[1]][[1]])))[2:4])
